home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_lamptorch.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  82 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_torch.cog
  4. #    An alternative to gen_torchlight if hardcoded values are preferable.
  5. #    Indy reach animation plays dependent on value of reach. Flame is present but invisible at startup 
  6. #    Best use: Rename for target level and adjust hardcoded values as required. 
  7. #
  8. # [SXC] [RKD]
  9. #
  10. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  11. #
  12. # ========================================================================================
  13.  
  14. symbols
  15.  
  16. message     activated
  17. message     startup
  18. message     timer
  19.  
  20. thing       torch                //the thing you light
  21. thing       flame    nolink        //flame, hidden at startup
  22.  
  23. sound       burning=gen_torch_burnin_c.wav  local
  24. sound       lite=gen_torchlitet_c.wav       local
  25.  
  26. vector      minlite        local
  27. vector      maxlite        local
  28.  
  29. flex        minradius=0.25    local
  30. flex        maxradius=0.3    local
  31.             
  32. flex        reach=0        //0 for medium, 1 for high
  33. flex        islit=0        //set to 1 if torch lights at startup
  34. flex        flicker=1    //set to 0 to eliminate flicker
  35. end
  36.  
  37. # ========================================================================================
  38.  
  39. code
  40.  
  41. startup:
  42.     player = GetLocalPlayerThing();
  43.     minlite = VectorSet(0.87, 0.55, 0.06);
  44.     maxlite = VectorSet(0.89, 0.64, 0.30);    
  45.     SetThingFlags(flame, 0x10);
  46.     SetThingLight(torch, VectorSet(0.0, 0.0, 0.0), 0.3, 0.1);
  47.  
  48.     if (islit) call lightit;    
  49.     return;
  50.  
  51. # ........................................................................................
  52. activated:
  53.     if (islit) return;
  54.     if ((GetCurWeapon(player) != 13) && (!InEditor())) return;
  55.     
  56.     PlayMode(player, (60 + reach), 0);
  57.     Sleep(0.5);        //no return, falls through to lightit
  58.  
  59. # ........................................................................................
  60.  
  61. lightit:
  62.     ClearThingFlags(flame, 0x10);
  63.     SetThingLight(torch, minlite, 0.3, 0.5);                           
  64.         
  65.     Sleep(0.5);
  66.     PlaySoundThing(lite, torch, 1.0, 5, 15, 0x0);                                 
  67.     PlaySoundThing(burning, torch, 1.0, 5, 15, 0x1);
  68.     islit = 1;
  69.     
  70.     if (flicker == 0) return;
  71.     ThingLightAnim(torch, minlite, minradius, maxlite, maxradius, 2);
  72.     return;
  73.         
  74. end
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.